﻿@*
    修改密码
*@
@model ChangePasswordModel
@using System.Linq
@using System.Reflection
@using NewLife
@using NewLife.Cube.Areas.Admin.Models
@using XCode
@using XCode.Configuration
@using NewLife.Cube.Entity;
@{
    var requireOldPass = Model.SsoName.IsNullOrEmpty();
}

<div class="layui-fluid" id="LAY-app-message">
    <div class="layui-card">
        <div class="layui-card-header"  style="padding: 15px;">
            @await Html.PartialAsync("_User_Nav")
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            
            @using (Html.BeginForm("ChangePassword", "User",FormMethod.Post,new { @class="layui-form",lay_filter="component-form"}))
            {
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">账号</label>
                    <div class="layui-input-inline">
                        <input type="text" lay-verify="title" autocomplete="off" placeholder="请输入账号" class="layui-input layui-disabled" value="@Model.Name" disabled="disabled">
                           @if (!Model.SsoName.IsNullOrEmpty())
                            {
                                <div class="layui-form-mid layui-word-aux">登录自 @Model.SsoName</div>
                            }
                    </div>
                </div>
                  @if (requireOldPass)
                    {
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">原密码</label>
                        <div class="layui-input-block">
                            <input type="password" name="OldPassword" lay-verify="pass" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    }
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">新密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="NewPassword" lay-verify="pass" autocomplete="off" class="layui-input">
                    </div>
               </div>     
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="NewPassword2" lay-verify="pass" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button type="submit" class="layui-btn" lay-submit="" lay-filter="component-form-element">保存</button>
                            <button type="button" class="layui-btn layui-btn-primary" onclick="history.go(-1);">取消</button>
                        </div>
                    </div>
                </div>
            }
        </div>
        </div>
</div>